<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<% String path = request.getContextPath(); %>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="<%=path%>/static/lib/html5shiv.js"></script>
<script type="text/javascript" src="<%=path%>/static/lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="<%=path%>/static/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/static/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/static/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/static/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="<%=path%>/static/static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="<%=path%>/static/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>添加学生信息</title>
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>
<div class="page-container">
	<form class="form form-horizontal" id="formAdd" action="<%=path%>/user/userAddSub"  method="post">

	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>真实姓名：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" style="width: 400px;" class="input-text" value="" placeholder="" id="realname" name="realname">
		</div>
	</div>

	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>学号：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" style="width: 400px;" class="input-text" value="" placeholder="" id="username" name="username">
		</div>
	</div>

	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>密码：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" style="width: 400px;" class="input-text" autocomplete="off" value="" id="password" name="password">
		</div>
	</div>

	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>手机：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" style="width: 400px;" class="input-text" value="" placeholder="" id="phone" name="phone">
		</div>
	</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>出生年月：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" style="width: 400px;" class="input-text" value="" placeholder="格式：1996/02/02" id="birthday" name="birthday">
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>是否团员：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<select style="width: 390px;" class="select" size="1" name="red">
					<option value="是">是</option>
					<option value="否">否</option>
				</select>
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>性别：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<select style="width: 390px;" class="select" size="1" name="sex">
					<option value="男">男</option>
					<option value="女">女</option>
				</select>
			</div>
		</div>


	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>邮箱：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" style="width: 400px;" class="input-text" value="" placeholder="" id="email" name="email">
		</div>
	</div>
	
	<div class="row cl">
			<div style="margin: 30px 0px 0 375px;"  class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存并提交审核</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>


<button style="VISIBILITY: hidden" class="btn btn-primary btn-lg"  data-toggle="modal" data-target="#myModal2" id="dialog"></button>
    
   <!-- 模态框（Modal） -->
   <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<h4 class="modal-title" id="myModalLabel">
					提示
				</h4>
			</div>
			<div class="modal-body">
				<p>${msg}</p>
			</div>
			<div class="modal-footer">
				<button type="button" onClick="layer_close();" class="btn btn-default" data-dismiss="modal">关闭
				</button>
			</div>
		</div><!-- /.modal-content -->
	  </div><!-- /.modal -->
     </div>



<!--_footer 作为公共模版分离出去--> 
<script type="text/javascript" src="<%=path%>/static/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="<%=path%>/static/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="<%=path%>/static/static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="<%=path%>/static/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="<%=path%>/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="<%=path%>/static/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="<%=path%>/static/lib/jquery.validation/1.14.0/messages_zh.js"></script> 
<script type="text/javascript">
function save(){
	alert("刷新父级的时候会自动关闭弹层。")
	window.parent.location.reload();
}
// 手机号码验证
jQuery.validator.addMethod("isMobile", function(value, element) {
    var length = value.length;
    var mobile = /^(13[0-9]{9})|(18[0-9]{9})|(14[0-9]{9})|(17[0-9]{9})|(15[0-9]{9})$/;
    return this.optional(element) || (length == 11 && mobile.test(value));
}, "请正确填写您的手机号码");
// 学号验证
jQuery.validator.addMethod("isNo", function(value, element) {
	var length = value.length;
	var no = /^[0-9]+.?[0-9]*$/;
	return this.optional(element) || (length == 9 && no.test(value));
}, "学号必须9位数字");


$().ready(function() {
    $("#formAdd").validate({
		rules: {
			username: {
				required: true,
				isNo:true
			},
			realname: "required",
			password: {
				required: true,
				minlength: 1
			},
			phone: {
				required: true,
				minlength : 11,
				isMobile : true
			},
			email:{
				required: true,
				email:true
			},
			birthday: "required",
			red: "required",
			sex: "required"
		},
		messages: {
			username: {
				required : "请输入学号",
				isNo : "学号为9位数字"
			},
			realname: "请输入真实名称",
			password: {
				required: "请输入密码",
				minlength: jQuery.format("密码不能小于{0}个字符")
			},
			phone: {
				required : "请输入手机号",
				minlength : "确认手机不能小于11个字符",
				isMobile : "请正确填写您的手机号码"
			},
			email: {
				required: "请输入Email地址",
				email: "请输入正确的email地址"
			},
			birthday: "请输入出生年月",
			red: "请选择是否是团员",
			sex: "请选择性别"
		}
    });
});


var msg="${msg}";    
if(msg != 'null' && msg != ""){
	 $(function(){
        $("#myModal2").modal({
           keyboard: true
       });
   });	
}
</script> 
<style>
    label.error{
        position: absolute;
        right: 300px !important;
        top: 5px;
        color: #ef392b;
        font-size: 12px;
    }
</style>
</body>
</html>